import React, { Component } from 'react';
// import Life from './Life';
// import From from './From';
import Com from './Com';
import Hoc from './HOC';
import Comment from './Comment';


class App extends Component {
  constructor() {
    super()
    this.state = {
      msg1: '我好困',
      isShow: true
    }
  }
  handlerKun() {
    this.setState({
      msg1: '我不困了！'
    })
  }
  handlerChange() {
    // 切换子组件的显示隐藏
    this.setState({
      isShow: !this.state.isShow
    })
  }
  render() {
    return (
      <div>
        {/* {this.state.isShow?<Life msg={this.state.msg1}></Life>:''} */}
        <button onClick={()=>this.handlerKun()}>父：修改msg1</button>
        <button onClick={()=>this.handlerChange()}>toggle</button>
        <hr></hr>
        {/* <From></From> */}
        {/* <Com></Com>
        <hr></hr>
        <Hoc></Hoc> */}
        <Comment></Comment>
      </div>
    );
  }
}

export default App;
